

uo.polr <- polr(as.factor(q63) ~ q150 + as.factor(q173) + q166 + dissimyesh*non.homogyesh 
             + factor(jer) + nonjewish_pcnt, data=obs.dat.uo)
uo.clustered = cl.polr(uo, uo.polr, obs.dat.uo$city)
uo.clustered.se <- sqrt(diag(uo.clustered)) 
outpout.uo <- as.data.frame(cbind(uo.polr$coefficients, uo.clustered.se[1:9]))

non.uo.polr <- polr(as.factor(q63) ~ q150 + as.factor(q173) + q166 + dissimyesh*homogyesh.100 
                  + factor(jer) + nonjewish_pcnt, data=obs.dat.non.uo)
non.uo.clustered = cl.polr(non.uo, non.uo.polr, obs.dat.non.uo$city)
non.uo.clustered.se <- sqrt(diag(non.uo.clustered))
outpout.non.uo <- as.data.frame(cbind(non.uo.polr$coefficients, non.uo.clustered.se[1:9]))

secular.polr <- polr(as.factor(q63) ~ q150 + as.factor(q173) + q166 + dissimyesh*homogyesh.100 
                  + factor(jer) + nonjewish_pcnt, data=obs.dat.secular)
secular.clustered = cl.polr(secular, secular.polr, obs.dat.secular$city)
secular.clustered.se <- sqrt(diag(secular.clustered))
outpout.secular <- as.data.frame(cbind(secular.polr$coefficients, secular.clustered.se[1:9]))

log <- capture.output({
  outtable = stargazer(uo.polr, non.uo.polr, secular.polr, 
                       se=list(uo.clustered.se, non.uo.clustered.se,secular.clustered.se),
                       star.cutoffs=0.05,  no.space=TRUE,
                       column.labels = c("UO", "Non-UO", "Secular"),
                       order=c(5,6,7,10,11,1,2,3,4,8,9),
                       covariate.labels=c("Segregation", "Outgroup Proportion", "Outgroup Proportion1",
                                          "Segregation x Outgroup Proportion", "Segregation x Outgroup Proportion",
                                          "Gender (female = 1)", "High Income", "Low Income", 
                                          "College (1 = yes)", "Jerusalem", "Arab Population"))
                    })



writeLines(
  outtable, 'output/appendix/Table_A1.tex')
